package com.demo11;

public class ExceptionDemo {
    public static void main(String[] args) {
        System.out.println("开始执行");
        method();
        System.out.println("结束执行");
    }

    public static void method(){
        try {
            int[] arr = {1,2,3};
            System.out.println(arr[3]);
        }catch (ArrayIndexOutOfBoundsException err){
//            System.out.println("索引超出边界"+err.getMessage());
            err.printStackTrace();
        }

    }
}
